#ifndef SMTP_H
#define SMTP_H

#pragma once
#include "SmtpBase.h"

namespace smtp {
    class Smtp
        : public SmtpBase {
    public:
        Smtp(std::string host = "smtp.qq.com", std::string port = "587");
        virtual ~Smtp();

        using SmtpBase::mail;
        using SmtpBase::quit;

    protected:
        virtual void        send(const std::string& msg) override;
        virtual std::string get_response() override;

    private:
        boost::asio::io_context        io_context;
        boost::asio::ip::tcp::resolver resolver;
        boost::asio::ip::tcp::socket   stream;
    };
}  // namespace smtp

#endif